﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace CompositionPlugin.Config
{
    public class ConfigSection : ConfigurationSection, IConfiguration
    {
        public virtual void Initialize() { }

        public ILogConfig Log
        {
            get 
            { 
                return this.LogConfig; 
            }
        }

        public ITempFileConfig TempFile
        {
            get
            {
                return this.TempFileConfig;
            }
        }

        public IPluginConfig Plugin
        {
            get
            {
                return this.PluginConfig;
            }
        }

        [ConfigurationProperty("log", IsKey = false, IsRequired = false)]
        public LogConfig LogConfig
        {
            get
            {
                return (LogConfig)base["log"];
            }
        }

        [ConfigurationProperty("tempFile", IsKey = false, IsRequired = false)]
        public TempFileConfig TempFileConfig
        {
            get
            {
                return (TempFileConfig)base["tempFile"];
            }
        }

        [ConfigurationProperty("plugin", IsKey = false, IsRequired = false)]
        public PluginConfig PluginConfig
        {
            get
            {
                return (PluginConfig)base["plugin"];
            }
        }

        public virtual void OnRuntimeDisposing() { }
    }
}
